#pragma once

#include <cstdio>

class Log
{
public:
	Log();
	Log(bool timerecord);
	Log(char *name);
	Log(char *name, bool timerecord);

	~Log();

	void print(const char *message, ...);
	void info(const char *message, ...);
	void warning(const char *message, ...);
	void error(const char *message, ...);

	void set_time_record(bool trec){_trec = trec;}

private:
	bool _trec;
	FILE *_file;
	const char *_name;
	void _init(const char *name);
	void _message_log(const char *levtext, const char *text);	
};

extern Log EngineLog;